package com.service;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.sql.SQLException;
import java.util.HashMap;

import com.type.User;

public class Server {
	static final int PORT = 9999;

	public static void main(String[] args) throws IOException, SQLException {
		(new Db()).initialTable();
		
		ServerSocket serverSocket = new ServerSocket(PORT);
		HashMap<Long, User> userMap = new HashMap<Long, User>();
		while (true) {
			System.out.println("new loop..........");
//			System.out.println("server have " + userMap.size() + " users");
			Socket socket = serverSocket.accept();
			new SocketSession(socket, userMap).start();
		}
	}
}
